package com.dailyblue.java.spring.cloud.example.sentinel.customer.service.impl;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.dailyblue.java.spring.cloud.example.commons.util.JsonResult;
import com.dailyblue.java.spring.cloud.example.sentinel.customer.feign.ProductFeign;
import com.dailyblue.java.spring.cloud.example.sentinel.customer.service.CustomerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CustomerServiceImpl implements CustomerService {
    @Resource
    private ProductFeign productFeign;

    @Override
    public JsonResult a() {
        return productFeign.a();
    }

    @Override
    public JsonResult b() {
        return productFeign.b();
    }

    @SentinelResource("message")
    public JsonResult c() {
        return productFeign.b();
    }

    @Override
    public JsonResult c1(Integer index) {
        return productFeign.c(index);
    }

}
